package demoxsgl_300.com.gouwu1500.zhi;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.AdapterView;
import android.widget.GridView;

import java.util.ArrayList;

import butterknife.BindView;
import butterknife.ButterKnife;
import demoxsgl_300.com.gouwu1500.R;
import demoxsgl_300.com.gouwu1500.adapter.Grid2ViewAdapter;
import demoxsgl_300.com.gouwu1500.adapter.GridViewAdapter;

public class DialogActivity extends Activity {

    @BindView(R.id.gv_images)
    GridView listview;
    Grid2ViewAdapter gridViewAdapter;
    ArrayList<String> qq;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_dialog);
        ButterKnife.bind(this);
        qq = getIntent().getStringArrayListExtra("qq");
        gridViewAdapter = new Grid2ViewAdapter(DialogActivity.this, qq);
        listview.setAdapter(gridViewAdapter);
        listview.setOnItemClickListener(new AdapterView.OnItemClickListener() {
            @Override
            public void onItemClick(AdapterView<?> adapterView, View view, int i, long l) {
                String s = qq.get(i);
                startActivity(new Intent(DialogActivity.this, FaZuoTeDian_1_Activity.class).putExtra("bb", s));
                finish();
            }
        });
    }

}
